package org.example.myleet.p944;

public class Solution {
    public int minDeletionSize(String[] strs) {
        int delCount = 0;
        int m = strs.length, n = strs[0].length(), m1 = m - 1;
        char[][] charMatrix = new char[m][0];
        for (int i = 0; i < m; ++i) {
            charMatrix[i] = strs[i].toCharArray();
        }
        for (int j = 0; j < n; ++j) {
            for (int i = 0; i < m1; ++i) {
                if (charMatrix[i][j] > charMatrix[i + 1][j]) {
                    ++delCount;
                    break;
                }
            }
        }
        return delCount;
    }
}
